" Vim syntax file
" Language:     Ch
" Maintainer:   SoftIntegration, Inc. <info@softintegration.com>
" URL:		http://www.softintegration.com/download/vim/syntax/ch.vim
" Last change:	2004 Sep 01
"		Created based on cpp.vim
"
" Ch is a C/C++ interpreter with many high level extensions
"

" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
syntax clear
"if version < 600
  "syntax clear
"elseif exists("b:current_syntax")
  "finish
"endif

" Read the C syntax to start with
if version < 600
  so <sfile>:p:h/c.vim
else
  runtime! syntax/c.vim
  unlet b:current_syntax
endif

" Ch extentions

syn keyword	chStatement	new delete this foreach
syn keyword	chAccess	public private
syn keyword	chStorageClass	__declspec(global) __declspec(local)
syn keyword	chStructure	class
syn keyword	chType		string_t array


" stc definition
syn keyword	stc_keyword	Set FileName ITERATE
syn keyword	stc_keyword_add	IFIN IFEQUAL NOTEQUAL
syn match stc_itkey /IT\d\?KEY/
syn match stc_itvalue /IT\d\?VALUE/
syn match stc_brace  /{[^\W}]*}/
syn match stc_1brace_s  /+<<+/
syn match stc_1brace_e  /+>>+/
syn match stc_2brace_s  /#{/
syn match stc_2brace_e  /}#/
syn match stc_iterate /ITERATE\s*%\w*\s*/
syntax region stc_sBlock 	start=/+<+/ end=/+>+/
"syntax region stc_iBlock 	transparent start=/+<<+/ end=/+>>+/ contains=stc_iBlock,@cCommentGroup,cCommentStartError,cSpaceError,@Spell,stc_key  
"syntax region stc_nBlock 	transparent start=/#{/ end=/}#/ contains=stc_nBlock
"syntax region stc_xBlock 	transparent start=/+<<+/ end=/+>>+/ contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell,stc_key  extend
"syn region	stc_brace	transparent start="+<<+" end="+>>+" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell extend
"syn region	stc_brace	transparent start="+<<+" end="+>>+" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell extend
if exists("c_curly_error")
  syntax match cCurlyError "}"
  "syntax region	stc_se		start="#{" end="}#" contains=ALLBUT,cCurlyError,@cParenGroup,cErrInParen,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell,stc_se fold
else
  "syntax region	stc_se		start="#{" end="}#" transparent fold
endif
"syn region	stc_se		transparent start="#{" end="}#" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell extend

" Default highlighting
if version >= 508 || !exists("did_ch_syntax_inits")
  if version < 508
    let did_ch_syntax_inits = 1
    command -nargs=+ HiLink hi link <args>
  else
    command -nargs=+ HiLink hi def link <args>
  endif
  HiLink chAccess		chStatement
  HiLink chExceptions		Exception
  HiLink chStatement		Statement
  HiLink chType			Type
  HiLink chStructure		Structure
" stc definition start
  HiLink stc_keyword		Type
  HiLink stc_keyword_add		Conditional
  "HiLink stc_se			Type
  "HiLink stc_xBlock		Conditional
  "HiLink stc_key		Type
  HiLink stc_iterate		Type
  HiLink stc_itkey		Type
  HiLink stc_itvalue		Type
  HiLink stc_sBlock		Structure
  HiLink stc_brace		Type
  HiLink stc_1brace_s		Structure
  HiLink stc_2brace_e		Conditional
  HiLink stc_2brace_s		Conditional
  HiLink stc_1brace_e		Type
  HiLink stc_temp		Type
" stc definition end
  delcommand HiLink
endif

let b:current_syntax = "stc"

" vim: ts=8
